package file;

import java.io.File;

public class DeleteFileDemo {
    public static void main(String[] args) {
        //./可以忽略不写,默认在当前目录下
    File file = new File("demo.txt");
    if (file.exists()){
        file.delete();
        System.out.println("删除成功");
    }else {
        System.out.println("文件不存在");
    }

    }
}
